// custom-tab-bar/index.js
Component({

  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    active: 0,
    "list": [
      {
        "pagePath": "/pages/index/index",
        "iconPath": "/pages/img/home_off.png",
        "selectedIconPath": "/pages/img/home_on.png",
        "text": "首页"
      },
     
      {
        "pagePath": "/pages/mof/mof",
        "iconPath": "/pages/img/home_off.png",
        "selectedIconPath": "/pages/img/home_on.png",
        "text": "首页"
      },
      {
        "pagePath": "/pages/wifi/wifi",
        "iconPath": "/pages/img/wifi_off.png",
        "selectedIconPath": "/pages/img/wifi_on.png",
        "text": "配网"
      },
      {
        "pagePath": "/pages/user/user",
        "iconPath": "/pages/img/user_off.png",
        "selectedIconPath": "/pages/img/user_on.png",
        "text": "用户"
      }
    ]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    onChange(e) {
      console.log(e);
      let path = e.currentTarget.dataset.path;
      let index = e.currentTarget.dataset.index;
      this.setData({
        active: index
      })
      wx.switchTab({
        url: path,
      })
    }
  }
})